<template>
  <div class="LookTemplate">
    <!-- 头部 -->
    <div class="top">
      <!-- 头部 -->
      <div class="head">
        <span class="blue"></span>
        <span class="pending">我的签字</span>
      </div>
    </div>
    <!-- 主体内容 -->
    <div class="content">
      <!-- 左边合同 -->
      <div class="left">
        <p>合同内容预览</p>
        <img src="../../assets/image/hetong.png" alt="" />
      </div>
      <br />
      <!-- 右边模板其他信息 -->
      <div class="right">
        <p class="title">模板其他信息</p>
        <el-form :model="form" label-width="100px">
          <el-form-item label-width="181px" label="模板名称">
            <el-input v-model="form.name" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="模板编号">
            <el-input v-model="form.id" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="合同类型">
            <el-input v-model="form.type" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="适用范围">
            <el-input v-model="form.apply" disabled></el-input>
          </el-form-item>
          <!-- <el-form-item label-width="181px" label="模板图标">
            <i></i>
          </el-form-item> -->
          <el-form-item label-width="181px" label="模板底稿">
            <el-input v-model="form.draft" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="模板有限期">
            <el-input v-model="form.time" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="合同描述">
            <el-input v-model="form.describe" disabled></el-input>
          </el-form-item>
          <el-form-item label-width="181px" label="启用/禁用">
            <el-input v-model="form.status" disabled></el-input>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      form: {
        name: '贷款服务合同',
        id: '20200830123456',
        type: '适用于个人类客户',
        apply: '贷款产品',
        icon: '',
        draft: '贷款服务合同.doc',
        time: '',
        describe: '',
        status: '启用'
      }
    }
  },
  created () {
    const templateData = JSON.parse(window.localStorage.getItem('templateDate'))
    this.form.name = templateData.templateName
    this.form.id = templateData.templateNo
    if (templateData.typeId === 1) {
      this.form.type = '适用个人类客户'
    } else if (templateData.typeId === 2) {
      this.form.type = '适用公司类客户'
    } else if (templateData.typeId === 3) {
      this.form.type = '通用类'
    }
    if (templateData.scopeId === 1) {
      this.form.apply = '贷款产品'
    } else if (templateData.scopeId === 2) {
      this.form.apply = '存款产品'
    } else if (templateData.scopeId === 3) {
      this.form.apply = '理财产品'
    } else if (templateData.scopeId === 4) {
      this.form.apply = '基金产品'
    } else if (templateData.scopeId === 5) {
      this.form.apply = '信托产品'
    } else if (templateData.scopeId === 5) {
      this.form.apply = '贵金属产品'
    }
    this.form.draft = templateData.path.split('/')[templateData.path.split('/').length - 1]
    this.form.time = templateData.startDate + ' 至 ' + templateData.endDate
    this.form.describe = templateData.details
    if (templateData.enable === 1) {
      this.form.status = '启用'
    } else if (templateData.enable === 2) {
      this.form.status = '禁用'
    } else if (templateData.enable === 3) {
      this.form.status = '已过期'
    }
  }
}
</script>

<style scoped lang="less">
.LookTemplate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10;
  .top {
    .head {
      margin: 0 26px;
      height: 56px;
      line-height: 20px;
      font-size: 14px;
      border-bottom: 1px solid #e3e3e3;
      .blue {
        width: 20px;
        height: 16px;
        line-height: 56px;
        background-color: rgba(82, 144, 255, 1);
        text-align: center;
        margin-left: 15px;
        border-left: 4px solid rgba(82, 144, 255, 1);
      }
      .pending {
        width: 54px;
        height: 27px;
        color: rgba(16, 16, 16, 1);
        font-size: 18px;
        font-weight: 700;
        text-align: left;
        margin-left: 13px;
        font-family: SourceHanSansSC-bold;
      }
    }
  }
  .content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    box-sizing: border-box;
    .left {
      width: 100%;
      padding-top: 10px;
      flex: 1;
      height: 766px;
      border: 1px solid #e3e3e3;
      text-align: center;
    }
    .right {
      padding-top: 10px;
      text-align: center;
      flex: 1;
      margin-left: 10px;
      height: 766px;
      border: 1px solid #e3e3e3;
      .title{
        margin-bottom: 41px;
        padding-top: 11px;
      }
    }
  }
}
/deep/ .el-input__inner {
  border: 0;
  border-style: none;
  padding: 0;
}
/deep/ .el-form-item__label{
  text-align: left;
  padding-left: 20px;
  box-sizing: border-box;
}
/deep/ .el-input.is-disabled .el-input__inner{
  background: #fff;
  color: #606266;
  cursor: auto;
}
</style>
